﻿


using System;

namespace Graph.Algorithm.Core;

public class GraphVertex
{
    public int id { get; set; } = 0;
    public string name { get; set; } = string.Empty;
    public Vector<double> position { get; set; } = Vector<double>.Build.Dense(3);
}

public class GraphEdge
{
    public int id { get; set; } = 0;
    public int stVertexId { get; set; } = 0;
    public int edVertexId { get; set; } = 0;
    public double weight { get; set; } = 0;



}


public class XYZ
{
    public static XYZ Zero { get; set; } = new XYZ();
    public static XYZ Unit { get; set; } = new XYZ(1, 1, 1);
    public static XYZ BasicX { get; set; } = new XYZ(1, 0, 0);
    public static XYZ BasicY { get; set; } = new XYZ(0, 1, 0);
    public static XYZ BasicZ { get; set; } = new XYZ(0, 0, 1);

    public XYZ(double _x = 0, double _y = 0, double _z = 0)
    {
        this.X = _x; this.Y = _y; this.Z = _z;
    }

    public double X { get; set; }
    public double Y { get; set; }
    public double Z { get; set; }

    public double Length()
    {
        return Math.Sqrt(X * X + Y * Y + Z * Z);
    }

    public XYZ Normal()
    {
        double length = this.Length();
        return this / length;
    }

    public static XYZ operator +(XYZ pnt1, XYZ pnt2)
    {
        return new XYZ(pnt1.X + pnt2.X, pnt1.Y + pnt2.Y, pnt1.Z + pnt2.Z);
    }
    public static XYZ operator -(XYZ pnt1, XYZ pnt2)
    {
        return new XYZ(pnt1.X - pnt2.X, pnt1.Y - pnt2.Y, pnt1.Z - pnt2.Z);
    }
    public static XYZ operator *(XYZ pnt, double value)
    {
        return new XYZ(pnt.X * value, pnt.Y * value, pnt.Z * value);
    }
    public static XYZ operator /(XYZ pnt, double value)
    {
        return new XYZ(pnt.X / value, pnt.Y / value, pnt.Z / value);
    }


}


 